module arithmetic(Clk_50M, Select, A, B, C, D);
	input [7:0] A;//8位被除数
	input [7:0] B;//8位除数
	input Clk_50M;
	input Select;//运算选择，0为除法，1为取模
	
	output reg[7:0] C;//8位商
	output reg[7:0] D;//8位余数
	
	always @(posedge Clk_50M) begin
		if(Select == 1'b1) begin
			C = A / B;
			D = 8'b0000_0000;
		end
		else begin
			C = 8'b0000_0000;
			D = A % B;
		end
	end
	
endmodule
